var max=0;function AsylumNavLink(parentId,linkId,order,href,linkText,target,width)
{this.linkId=linkId;this.parentId=parentId;this.order=order;this.href=href;this.linkText=linkText;this.target=target;this.width=width;};function AsylumNav(contId,layout,offset)
{this.menuCont=document.getElementById(contId);this.layout=layout;this.offset=(typeof offset=='undefined'?'Right':offset);this.menuItems=new Object();this.clickUnderCreated=false;};AsylumNav.prototype.AddLink=function(parentId,linkId,order,href,linkText,target,width)
{if(typeof this.menuItems[parentId]=='undefined')
{this.menuItems[parentId]=new Object();}
if(typeof width=="undefined")width=false;this.menuItems[parentId][linkId]=new AsylumNavLink(parentId,linkId,order,href,linkText,target,width);if(order>max){max=order;}};AsylumNav.prototype.CreateLevel=function(levelId,idPrefix)
{obj=this;div=document.createElement('div');div.id=idPrefix+levelId;div.levelId=levelId;div.idPrefix=idPrefix;div.className='levelDiv';div.onmouseout=function(e){obj.HideLevel(e);};div.subLevels=new Object();if(levelId!='0')
{div.style.visibility='hidden';div.className+=' subLevel';div.style.position='absolute';}
else
{div.className+=' topLevel';}
if(this.layout=='Horizontal')
{div.style.position='absolute';}
div.style.zIndex=10;if(this.menuCont){this.menuCont.appendChild(div);}
for(i=0;i<=max;i++){for(linkId in this.menuItems[levelId]){if(this.menuItems[levelId][linkId].order==i){linkDiv=document.createElement('div');linkDiv.id='asylumNavLinkDiv'+linkId;linkDiv.linkId=linkId;linkDiv.levelId=levelId;linkDiv.className='linkDiv';if(levelId=="0"){linkDiv.className+=" topLevel";if(this.menuItems[levelId][linkId].width){linkDiv.style.width=this.menuItems[levelId][linkId].width+"px";}}
div.appendChild(linkDiv);navLink=this.menuItems[levelId][linkId];a=document.createElement('a');a.id='asylumNavLink'+linkId;a.linkType='navMenu';a.linkId=linkId;a.levelId=navLink.parentId;a.parentId=navLink.parentId;if(navLink.href==''||navLink.href=='#')
{a.href='#';a.target='';a.style.cursor='default';}
else
{a.href=navLink.href;a.target=navLink.target;}
if(this.layout=='Vertical')
{a.innerHTML=navLink.linkText;}
else
{a.innerHTML=navLink.linkText.split(' ').join('&nbsp;');}
a.onmouseover=function(){obj.ShowLevel(this);};linkDiv.appendChild(a);if(linkId==pageId)
{a.className='activeLink';linkDiv.className+=' activeLink';topLink=this.GetTopLevelLink(navLink);if(typeof this.menuItems[topLink.linkId]!='undefined'&&navLink.levelId!='0')
{try{document.getElementById('asylumNavLink'+topLink.linkId).className+=' activeLink';document.getElementById('asylumNavLinkDiv'+topLink.linkId).className+=' activeLink';}catch(e){}}
if(document.getElementById("clickUnder")!=null)
{this.CreateClickUnder(topLink,true);}}
else
{}
if(typeof this.menuItems[linkId]!='undefined')
{div.subLevels[linkId]=true;}}}}
return div;};AsylumNav.prototype.Construct=function()
{if(this.menuCont==null){return;}
var obj=this;for(levelId in this.menuItems)
{this.CreateLevel(levelId,'asylumNavLevel');}
if(this.layout=='Vertical')
{if(typeof document.getElementById('tplMainSectors')!=null)
{ms=document.getElementById('tplMainSectors');ms.style.height=ms.offsetHeight;}}
else
{this.menuCont.style.height=document.getElementById('asylumNavLevel0').offsetHeight+'px';}
this.CreateBreadCrumbs();};AsylumNav.prototype.CreateClickUnder=function(navLink,active)
{if(typeof doneClickUnder=="undefined"){doneClickUnder=true;}else{return;}
if(document.getElementById("clickUnder")==null)return;obj=this;var linkId;if(this.layout=='Vertical')
{clickDiv=document.createElement('div');clickDiv.id="clickUnder";document.getElementById("clickUnder").appendChild(clickDiv);linkDiv=document.getElementById('asylumNavLinkDiv'+navLink.linkId);linkDiv.appendChild(clickDiv);}
else
{clickDiv=document.getElementById("clickUnder");}
var linkCount=0;for(linkId in this.menuItems[navLink.linkId])
{linkCount++;clickLinkDiv=document.createElement('div');clickLinkDiv.className='clickLinkDiv';clickLink=this.menuItems[navLink.linkId][linkId];txt=document.createTextNode(' ');clickDiv.appendChild(txt);a=document.createElement('a');a.id='asylumNavClickLink'+clickLink.linkId;a.className='clickLink';a.linkType='clickLink';a.linkId=linkId;a.levelId=clickLink.parentId;a.parentId=clickLink.parentId;if(clickLink.href==''||clickLink.href=='#'){a.href='#';a.target='';a.style.cursor='default';}else{a.href=clickLink.href;a.target=clickLink.target;}
if(this.layout=="Vertical"){a.innerHTML=clickLink.linkText;}else if(this.layout=="Horizontal-SubMenu"){if(clickLink.linkText.substring(0,1)==" "){a.innerHTML=clickLink.linkText.split(" ").join("&nbsp;");}else{a.innerHTML=clickLink.linkText;}}else{a.innerHTML=clickLink.linkText.split(" ").join("&nbsp;");}
a.onmouseover=function(){obj.HideAllLevels();obj.ShowLevel(this);};a.onmouseout=function(e){obj.HideLevel(e);};clickLinkDiv.appendChild(a);if(linkId==pageId)
{a.className='activeLink';clickLinkDiv.className+=' activeLink';}
clickDiv.appendChild(clickLinkDiv);txt=document.createTextNode(' ');clickDiv.appendChild(txt);}
if(linkCount==0||active==false)
{clickDiv.className='inactiveClickUnder';}
else
{clickDiv.className='activeClickUnder';}};AsylumNav.prototype.GetTopLevelLink=function(navLink)
{if(navLink.parentId=='0')
{return(navLink);}
while(1==1)
{navLink=this.GetParentLink(navLink);if(typeof navLink.parentId!='undefined')
{if(navLink.parentId=='0')
{break;}}}
return(navLink);};AsylumNav.prototype.GetParentLink=function(navLink)
{var levelId;var linkId;for(levelId in this.menuItems)
{for(linkId in this.menuItems[levelId])
{parNavLink=this.menuItems[levelId][linkId];if(parNavLink.linkId==navLink.parentId)
{return(parNavLink);}}}};AsylumNav.prototype.GetXPos=function(obj)
{var curleft=0;if(obj.offsetParent)
{while(obj.offsetParent&&obj.id!='navMenuCont')
{curleft+=obj.offsetLeft;obj=obj.offsetParent;}}
else if(obj.x)
curleft+=obj.x;return curleft;};AsylumNav.prototype.GetYPos=function(obj)
{var curtop=0;if(obj.offsetParent)
{while(obj.offsetParent&&obj.id!='navMenuCont')
{curtop+=obj.offsetTop;obj=obj.offsetParent;}}
else if(obj.y)
curtop+=obj.y;return curtop;};AsylumNav.prototype.ShowLevel=function(el)
{levelId=el.linkId;this.currentLevelId=levelId;window.clearTimeout(this.timeoutId);this.HideSubLevels(el.levelId);if(typeof this.menuItems[levelId]=='undefined')
{return;}
if(el.linkType=='clickLink')
{eP=document.getElementById('asylumNavClickLink'+el.linkId);eL=document.getElementById('asylumNavLevel'+levelId);SwapClass(eL,'subLevel','clickUnderSubLevel');}
else
{eP=document.getElementById('asylumNavLink'+levelId);eL=document.getElementById('asylumNavLevel'+levelId);SwapClass(eL,'clickUnderSubLevel','subLevel');}
if(eP.parentId=='0')
{switch(this.offset)
{case'Right':offsetX=(eP.offsetWidth);offsetY=0;break;case'Left':offsetX=(-eL.offsetWidth);offsetY=0;break;case'Bottom':offsetX=0;offsetY=eP.offsetHeight;eL.style.minWidth=eP.offsetWidth;break;}}
else
{switch(this.offset)
{case'Left':offsetX=(-eL.offsetWidth);offsetY=0;break;default:offsetX=(eP.offsetWidth);offsetY=0;break;}}
pX=this.GetXPos(eP);pY=this.GetYPos(eP);lX=pX+offsetX;lY=pY+offsetY;eL.style.position='absolute';$(eL).css({left:lX,top:lY});eL.style.visibility='visible';};AsylumNav.prototype.GetLevelWidth=function(levelId)
{maxWidth=0;for(linkId in this.menuItems[levelId])
{a=document.getElementById('asylumNavLink'+linkId);thisWidth=a.offsetWidth;if(thisWidth>maxWidth)
{maxWidth=thisWidth;}}
return(maxWidth);};AsylumNav.prototype.HideSubLevels=function(levelId,omitLevelId)
{if(typeof omitLevelId=='undefined')
{omitLevelId='0';}
eL=document.getElementById('asylumNavLevel'+levelId);for(levelId in eL.subLevels)
{this.HideSubLevels(levelId);if(levelId!=omitLevelId)
{eL=document.getElementById('asylumNavLevel'+levelId);eL.style.visibility='hidden';}}};AsylumNav.prototype.HideLevel=function(e)
{window.clearTimeout(this.timeoutId);if(!e)e=window.event;var el=(e.relatedTarget)?e.relatedTarget:e.toElement;var obj=this;var funct=function(){obj._HideLevel(el);};this.timeoutId=window.setTimeout(funct,1000);};AsylumNav.prototype._HideLevel=function(el)
{if(!el||el.id.substr(0,9)!='asylumNav'||(el.id.substr(0,9)=='asylumNav'&&el.style.visibility=='hidden'))
{this.HideAllLevels();}};AsylumNav.prototype.HideAllLevels=function()
{for(levelId in this.menuItems)
{if(levelId!='0')
{eL=document.getElementById('asylumNavLevel'+levelId);if(eL!=null)eL.style.visibility='hidden';}}};AsylumNav.prototype.CreateBreadCrumbs=function()
{if(document.getElementById("breadCrumbs")!=null)
{crumbsCont=document.getElementById("breadCrumbs");crumbsCont.style.display='none';crumbs='';homeLink='';for(levelId in this.menuItems)
{for(linkId in this.menuItems[levelId])
{navLink=this.menuItems[levelId][linkId];if(homeLink=='')
{homeLink='<a href="'+navLink.href+'" target="'+navLink.target+'">'
+navLink.linkText+'</a> &gt; ';}
if(linkId==pageId)
{i=0;parNavLink=this.GetParentLink(navLink);while(typeof parNavLink=='object')
{i++;crumbs='<a href="'+parNavLink.href+'" target="'+parNavLink.target+'">'
+parNavLink.linkText+'</a> &gt; '+crumbs;parNavLink=this.GetParentLink(parNavLink);}
if(i>1)
{crumbsCont.style.display='block';crumbsCont.innerHTML=homeLink+crumbs+'<span class="activeCrumb">'+navLink.linkText+'</span>';}
return(true);}}}}};function RemoveClass(el,className)
{var replaceName=(el.className.match(' '+className)?' '+className:className);el.className=el.className.replace(replaceName,'');};function AddClass(el,className)
{RemoveClass(el,className);el.className+=' '+className;};function SwapClass(el,removeClassName,addClassName)
{RemoveClass(el,removeClassName);AddClass(el,addClassName);};;$(function() {for (var i in tasks) {window.setTimeout(tasks[i], 0);}});function initMenu(){};$(function(){$("#navMenu").navmenu({pageInfo:{"a355344":{"P":0,"ID":355354,"C":355344,"O":0,"U":"http:\/\/www.nfad.co.nz\/","N":"Home","T":"_top","R":"","RT":"_blank"},"a359459":{"P":355344,"ID":518115,"C":359459,"O":"1","U":"http:\/\/www.nfad.co.nz\/Civil-defence-equipment.html","N":"About Us","T":"_top","R":"","RT":"_blank"},"a452283":{"P":355344,"ID":452285,"C":452283,"O":"2","U":"http:\/\/www.nfad.co.nz\/civil-defence-cd.html","N":"Civil Defence","T":"_top","R":"","RT":"_blank"},"a356153":{"P":452283,"ID":356153,"C":356153,"O":"1","U":"http:\/\/www.nfad.co.nz\/civil-defence-components.html","N":"Components","T":"_top","R":"","RT":"_blank"},"a470074":{"P":356153,"ID":470124,"C":470074,"O":"1","U":"http:\/\/www.nfad.co.nz\/Equipment-defence-Civil.html","N":"Equipment","T":"_top","R":"","RT":"_blank"},"a470174":{"P":356153,"ID":470176,"C":470174,"O":"2","U":"http:\/\/www.nfad.co.nz\/cd-food-water.html","N":"Food &amp; Water","T":"_top","R":"","RT":"_blank"},"a470025":{"P":356153,"ID":470153,"C":470025,"O":"3","U":"http:\/\/www.nfad.co.nz\/civil-defence-tools.html","N":"Tools","T":"_top","R":"","RT":"_blank"},"a452278":{"P":452283,"ID":452286,"C":452278,"O":"2","U":"http:\/\/www.nfad.co.nz\/Kitsets-first-aid.html","N":"Kits","T":"_top","R":"","RT":"_blank"},"a452235":{"P":452283,"ID":452237,"C":452235,"O":"4","U":"http:\/\/www.nfad.co.nz\/first-aid-packs.html","N":"Packs","T":"_top","R":"","RT":"_blank"},"a470189":{"P":452235,"ID":470190,"C":470189,"O":"1","U":"http:\/\/www.nfad.co.nz\/civil-defence-packs.html","N":"Pandemic","T":"_top","R":"","RT":"_blank"},"a470191":{"P":452235,"ID":470192,"C":470191,"O":"2","U":"http:\/\/www.nfad.co.nz\/civil-defence-survival.html","N":"Survival","T":"_top","R":"","RT":"_blank"},"a356156":{"P":355344,"ID":356156,"C":356156,"O":"3","U":"http:\/\/www.nfad.co.nz\/first-aid-first.html","N":"First-Aid","T":"_top","R":"","RT":"_blank"},"a470232":{"P":356156,"ID":625781,"C":470232,"O":"1","U":"http:\/\/www.nfad.co.nz\/first-aid-components.html","N":"Components","T":"_top","R":"","RT":"_blank"},"a470235":{"P":356156,"ID":470245,"C":470235,"O":"2","U":"http:\/\/www.nfad.co.nz\/First-aid-kitsets.html","N":"Kits","T":"_top","R":"","RT":"_blank"},"a498938":{"P":355344,"ID":498939,"C":498938,"O":"4","U":"http:\/\/www.nfad.co.nz\/shoe-footwear-safety.html","N":"Footwear","T":"_top","R":"","RT":"_blank"},"a356136":{"P":498938,"ID":356136,"C":356136,"O":"1","U":"http:\/\/www.nfad.co.nz\/trekking-outdoors-footwear.html","N":"Grisport","T":"_top","R":"","RT":"_blank"},"a356137":{"P":498938,"ID":356137,"C":356137,"O":"2","U":"http:\/\/www.nfad.co.nz\/safety-toe-cap.html","N":"Howler","T":"_top","R":"","RT":"_blank"},"a427943":{"P":498938,"ID":427944,"C":427943,"O":"3","U":"http:\/\/www.nfad.co.nz\/flex-composite-safety.html","N":"No.8","T":"_top","R":"","RT":"_blank"},"a426034":{"P":498938,"ID":426035,"C":426034,"O":"4","U":"http:\/\/www.nfad.co.nz\/steel-toecap-midsole.html","N":"Steel Blue","T":"_top","R":"","RT":"_blank"},"a356140":{"P":355344,"ID":356140,"C":356140,"O":"6","U":"http:\/\/www.nfad.co.nz\/safety-equipment-visors.html","N":"Safety","T":"_top","R":"","RT":"_blank"},"a421914":{"P":356140,"ID":421916,"C":421914,"O":"1","U":"http:\/\/www.nfad.co.nz\/safety-clothing-tshirts.html","N":"Environmental","T":"_top","R":"","RT":"_blank"},"a356142":{"P":356140,"ID":356142,"C":356142,"O":"2","U":"http:\/\/www.nfad.co.nz\/safety-eye-face.html","N":"Eye Protection","T":"_top","R":"","RT":"_blank"},"a441374":{"P":356142,"ID":441387,"C":441374,"O":"1","U":"http:\/\/www.nfad.co.nz\/safety-eye-protection.html","N":"Accessories","T":"_top","R":"","RT":"_blank"},"a441379":{"P":356142,"ID":441386,"C":441379,"O":"2","U":"http:\/\/www.nfad.co.nz\/safety-eye-goggles.html","N":"Goggles","T":"_top","R":"","RT":"_blank"},"a441380":{"P":356142,"ID":626763,"C":441380,"O":"3","U":"http:\/\/www.nfad.co.nz\/eye-protection-safety.html","N":"Safety Specs","T":"_top","R":"","RT":"_blank"},"a441382":{"P":356142,"ID":441383,"C":441382,"O":"4","U":"http:\/\/www.nfad.co.nz\/welding-eye-protection.html","N":"Welding","T":"_top","R":"","RT":"_blank"},"a356143":{"P":356140,"ID":356143,"C":356143,"O":"3","U":"http:\/\/www.nfad.co.nz\/safety-fire-safety.html","N":"Fire Safety","T":"_top","R":"","RT":"_blank"},"a501774":{"P":356140,"ID":501776,"C":501774,"O":"4","U":"http:\/\/www.nfad.co.nz\/safety-general-equipment.html","N":"General","T":"_top","R":"","RT":"_blank"},"a441315":{"P":356140,"ID":441338,"C":441315,"O":"5","U":"http:\/\/www.nfad.co.nz\/safety-gloves-protection.html","N":"Gloves","T":"_top","R":"","RT":"_blank"},"a441388":{"P":441315,"ID":441389,"C":441388,"O":"1","U":"http:\/\/www.nfad.co.nz\/safety-gloves-chemical.html","N":"Chemical","T":"_top","R":"","RT":"_blank"},"a441415":{"P":441315,"ID":441416,"C":441415,"O":"2","U":"http:\/\/www.nfad.co.nz\/cut-resistant-gloves.html","N":"Cut Resistant","T":"_top","R":"","RT":"_blank"},"a441417":{"P":441315,"ID":441418,"C":441417,"O":"3","U":"http:\/\/www.nfad.co.nz\/safety-gloves-disposable.html","N":"Disposable","T":"_top","R":"","RT":"_blank"},"a441419":{"P":441315,"ID":441420,"C":441419,"O":"4","U":"http:\/\/www.nfad.co.nz\/safety-gloves-knitted.html","N":"Knitted","T":"_top","R":"","RT":"_blank"},"a441421":{"P":441315,"ID":441422,"C":441421,"O":"5","U":"http:\/\/www.nfad.co.nz\/safety-gloves-leather.html","N":"Leather","T":"_top","R":"","RT":"_blank"},"a441423":{"P":441315,"ID":441424,"C":441423,"O":"6","U":"http:\/\/www.nfad.co.nz\/material-handling-gloves.html","N":"Material Handling","T":"_top","R":"","RT":"_blank"},"a441425":{"P":441315,"ID":441426,"C":441425,"O":"7","U":"http:\/\/www.nfad.co.nz\/safety-gloves-nitrile.html","N":"Nitrile","T":"_top","R":"","RT":"_blank"},"a441427":{"P":441315,"ID":441428,"C":441427,"O":"8","U":"http:\/\/www.nfad.co.nz\/safety-gloves-pvc.html","N":"PVC","T":"_top","R":"","RT":"_blank"},"a441429":{"P":441315,"ID":441430,"C":441429,"O":"9","U":"http:\/\/www.nfad.co.nz\/safety-gloves-rubber.html","N":"Rubber","T":"_top","R":"","RT":"_blank"},"a356146":{"P":356140,"ID":356146,"C":356146,"O":"6","U":"http:\/\/www.nfad.co.nz\/safety-head-protection.html","N":"Head Protection","T":"_top","R":"","RT":"_blank"},"a356147":{"P":356140,"ID":356147,"C":356147,"O":"7","U":"http:\/\/www.nfad.co.nz\/safety-hearing-protection.html","N":"Hearing Protection","T":"_top","R":"","RT":"_blank"},"a441431":{"P":356147,"ID":441438,"C":441431,"O":"1","U":"http:\/\/www.nfad.co.nz\/hearing-protection-accessories.html","N":"Accessories","T":"_top","R":"","RT":"_blank"},"a441439":{"P":356147,"ID":626330,"C":441439,"O":"2","U":"http:\/\/www.nfad.co.nz\/hearing-protection-earmuffs.html","N":"Earmuffs","T":"_top","R":"","RT":"_blank"},"a441441":{"P":356147,"ID":441442,"C":441441,"O":"3","U":"http:\/\/www.nfad.co.nz\/hearing-protection-earplugs.html","N":"Earplugs","T":"_top","R":"","RT":"_blank"},"a498170":{"P":356140,"ID":498193,"C":498170,"O":"8","U":"http:\/\/www.nfad.co.nz\/height-safety-barrier.html","N":"Height Safety","T":"_top","R":"","RT":"_blank"},"a356150":{"P":356140,"ID":356150,"C":356150,"O":"9","U":"http:\/\/www.nfad.co.nz\/respitory-protection-valved.html","N":"Respiratory","T":"_top","R":"","RT":"_blank"},"a441443":{"P":356150,"ID":441444,"C":441443,"O":"1","U":"http:\/\/www.nfad.co.nz\/respitory-protection-accessories.html","N":"Accessories","T":"_top","R":"","RT":"_blank"},"a441445":{"P":356150,"ID":441446,"C":441445,"O":"2","U":"http:\/\/www.nfad.co.nz\/spill-control-disposable.html","N":"Disposable","T":"_top","R":"","RT":"_blank"},"a441449":{"P":356150,"ID":441452,"C":441449,"O":"3","U":"http:\/\/www.nfad.co.nz\/wet-weather-gear.html","N":"Face Masks","T":"_top","R":"","RT":"_blank"},"a441454":{"P":356150,"ID":441455,"C":441454,"O":"4","U":"http:\/\/www.nfad.co.nz\/respiratory-powered-air.html","N":"Powered Air","T":"_top","R":"","RT":"_blank"},"a356160":{"P":355344,"ID":356160,"C":356160,"O":"8","U":"http:\/\/www.nfad.co.nz\/safety-footwear-feet.html","N":"Enquiry Form","T":"_top","R":"","RT":"_blank"},"a356162":{"P":355344,"ID":518135,"C":356162,"O":"9","U":"http:\/\/www.nfad.co.nz\/Foot-safety-footwear.html","N":"Contact Us","T":"_top","R":"","RT":"_blank"}},alignment:"Vertical",animate:0})});